/*
 * nume: client-to-client-thread-client.h
 * autor: ~D
 * descriere: thread-ul pe care il creaza un client cand se conecteaza la un alt client
 * tabela de modificarei
 *   12 iunie 2007 - ~D - prima versiune
 */

#ifndef CLIENT_TO_CLIENT_THREAD_CLIENT_H__
#define CLIENT_TO_CLIENT_THREAD_CLIENT_H__

#include <QThread>
#include <QMutex>
#include <QWaitCondition>

class ClientToClientThreadClient : public QThread {
        Q_OBJECT

    public:
        ClientToClientThreadClient( QObject *parent = 0 );
        ~ClientToClientThreadClient();

        void requestNewFortune( const
                                QString &hostName, quint16 port );

        void run();

    signals:
        void newFortune( const
                         QString &fortune );

        void error( int socketError, const
                    QString &message );

    private:
        QString hostName;

        quint16 port;

        QMutex mutex;

        QWaitCondition cond;

        bool quit;
};

#endif
